package com.xxmw.transaction.service.app.event;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

import com.xxmw.transaction.model.app.Hedging;

/**
 * 搬砖事件发布者
 */
@Component
public class SymbolAggregationPublisher implements ApplicationEventPublisherAware {
	
	private ApplicationEventPublisher applicationEventPublisher;

	/**
	 * 发布搬砖请求
	 * @param hedging
	 */
	public void publish(Hedging hedging) {
		this.applicationEventPublisher.publishEvent(new SymbolAggregationEvent(this, hedging)); //此处new对象有内存溢出风险
	}

	@Override
	public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
		this.applicationEventPublisher = applicationEventPublisher;
	}

}
